import random
num = random.randint(1,100)
guess = True
count = 1
while guess:
    guess_num = int(input(f"输入你第{count}次要猜的数字："))
    if guess_num == num:
        print(f"恭喜你猜对了，你一共猜了{count}次")
        guess = False
    elif guess_num > num:
            print("猜错啦，猜大了")
            count += 1
    else:
            print("猜错啦，猜小了")
            count += 1
